package com.dzu.easy;

import java.util.ArrayList;
import java.util.List;

/**
 * @author ZhaoDong
 * @date 2022/10/18 9:40
 * @description 412. Fizz Buzz
 */
public class Test412 {


    public List<String> fizzBuzz(int n) {
        List<String> list = new ArrayList<>();
        for (int i = 1; i <= n; i++) {
            int i3 = i % 3;
            int i5 = i % 5;
            if (i3 == 0 && i5 == 0) {
                list.add("FizzBuzz");
                continue;
            }
            if (i3 == 0) {
                list.add("Fizz");
                continue;
            }
            if (i5 == 0) {
                list.add("Buzz");
                continue;
            }
            list.add(String.valueOf(i));

        }
        return list;
    }
}
